package cloud.demarcia.rabbitregister.exception;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

/**
 * @author Bojun Wen, wen_bj@outlook.com
 * @date 2022.02.26
 */
public class RabbitUtilException extends RuntimeException{
    public RabbitUtilException(String message) {
        super(message);
    }
    public String getErrorMessage(){
        JSONObject jsonObject = JSONUtil.createObj()
                .putOnce("code","627")
                .putOnce("message",getMessage());
        return JSONUtil.toJsonStr(jsonObject);
    }
    public int getErrorCode(){
        return 627;
    }
}
